package com.xzbd.perspective;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

import com.xzbd.navigator.MainNavigator;
import com.xzbd.views.MessageConsoleView;

public class MainPerspective implements IPerspectiveFactory {
	public static final String ID = "com.xzbd.perspective.MainPerspective";

	@Override
	public void createInitialLayout(IPageLayout layout) {
		layout.setEditorAreaVisible(true);
		layout.setFixed(false);

		String editorArea = layout.getEditorArea();

		// 左侧 导航
		IFolderLayout leftTopFolder = layout.createFolder("LEFT", IPageLayout.LEFT, 0.18f, editorArea);
		leftTopFolder.addView(MainNavigator.ID);

		// 右侧
		IFolderLayout leftRightFolder = layout.createFolder("RIGHT", IPageLayout.RIGHT, 0.8f, editorArea);
		leftRightFolder.addView(IPageLayout.ID_OUTLINE);

		// 添加下部视图
		IFolderLayout tabs = layout.createFolder("BOTTOM", IPageLayout.BOTTOM, 0.6f, editorArea);
		// 属性
//		tabs.addPlaceholder(IPageLayout.ID_PROP_SHEET);
		// console view
		tabs.addView(MessageConsoleView.ID);
	}

}
